Method and apparatus for updating device driver control data

ABSTRACT

A method and apparatus for updating control data for a device driver that is stored on a first non-volatile memory. New driver control data is written to a second non-volatile memory.

FIELD OF THE INVENTION

[0001] Embodiments of the present invention provide a method andapparatus for updating device driver control data. More particularly,embodiments of the present invention provide a method and apparatus formodifying the control data that is used by a device driver in a computersystem, or for providing new control data to the device driver.

BACKGROUND OF THE INVENTION

[0002] A device driver is a program that controls a peripheral device ina computer system. An example of a device driver is a video driver,which controls a video device, such as a cathode ray tube (CRT) monitor.Other examples of device drivers are a keyboard driver, a mouse driver,or a modem driver. In a computer system, device drivers are typicallystored on the disk drive. Device drivers contain control data thatspecify parameters which are used by the device driver to control theperipheral. For example, the control data for a video driver includestiming or mode data, such as dot clock, control register, and watermarkdata. Dot clock and control register data specify parameters for thetiming of signals that are sent to the video display device, andwatermark data specifies parameters for the input bandwidth to the videodisplay device.

[0003] It is periodically necessary to modify the control data for adevice driver. For example, the timing control data for a video devicedriver may have to be changed when the system configuration changes,such as when a new processor is installed in the system. In addition, itmay be necessary to change the device driver control data to fix a flawin the system. Another example of modifying device driver control datais adding new video driver control data to support a new video displaymode that is being added to the system, such as the addition of 1024bit×768 bit×16 bit resolution capability, or a new frequency or clockingscheme.

[0004] Previously, device driver control data was stored on the samestorage medium as the device driver (e.g., a disk memory). In somesystems, the control data was hard-coded into the device driver. Inother systems, the control data was stored separately on the storagemedium. If the device driver control data is stored on a disk memory,for example, then updating the control data requires that the datastored in the disk memory (“the disk image”) be modified. If the drivercontrol data is hard-coded into the driver, then the only practical wayto modify the control data is to install a new driver. This can beexpensive because drivers are typically as large as one-half a millionlines of code, and because different drivers may be produced bydifferent manufactures. Even if the driver control data is storedseparately on the disk memory, it is necessary to perform the sometimesexpensive and difficult task of modifying the disk memory. If anorganization is operating a network that has hundreds of personalcomputers, for example, this may require the organization's InformationTechnology (IT) department to back-up and restore the disk image foreach of these computers because the disk memories may contain user dataor other software.

[0005] Based on the foregoing, there is a need for a method andapparatus for updating device driver control data without modifying thecontents of the storage medium that stores the device driver.

BRIEF DESCRIPTION OF THE DRAWINGS

[0006]FIG. 1 is a block diagram of a computer system which contains adevice driver having control data that may be updated according to oneembodiment of the present invention.

[0007]FIG. 2 is a flow chart of a method of updating control data for adevice driver according to one embodiment of the present invention.

[0008]FIG. 3 is a flow chart of a method by which a disk driver mayobtain supplemental control data according to one embodiment of thepresent invention.

[0009]FIG. 4 is a diagram of a device driver supplemental control datatable according to one embodiment of the present invention.

DETAILED DESCRIPTION

[0010] Embodiments of the present invention provide a method andapparatus for updating device driver control data without modifying thecontents of the storage medium that stores the device driver. FIG. 1 isa block diagram of a computer system 100 which contains a device driverhaving control data that may be updated according to one embodiment ofthe present invention. System 100 contains a processor 101 coupled to achipset 102. The chipset may be coupled to a system memory 103 and anumber of peripheral devices such as modem 108, display 109, and storagemedium 110. The chipset is also coupled to non-volatile memory 120.Processor 101, system memory 103, modem 108, display 109, and storagemedium 110 maybe coupled to chipset 102 by one or more busses and maycommunicate with each other through chipset 102. The term “coupled” isintended to encompass and be broader than the term “directly connected,”and also includes the term “indirectly connected.” Processor 101 may bea general purpose microprocessor, such as the Pentium II® processor madeby the Intel Corporation®) of Santa Clara, Calif., or may be anapplication specific processor. System memory may be, for example, 64Kof DRAM. Modem 108 may be connected though a telephone system to anetwork such as the Internet. Display 109 may be a standard computerdisplay device such as a CRT monitor or a liquid crystal diode (LCD)display.

[0011] Storage medium 110 may be a computer disk driver or othernon-volatile memory device and may store an operating system 112 (suchas Microsoft (Windows98®), a device driver 114, and device drivercontrol data update instructions 117. Device driver 114 may be, forexample, a video device driver that controls display 109. Device driver114 could also be, for example, a modem device driver that controlsmodem 108. Device driver 114 contains device driver control data 115,which specifies parameters used by device driver 114 to control aperipheral. For example, assuming that device driver 114 is a videodevice driver, control data 115 may the mode data or timing data used byvideo device driver 114 to control display 109. In this example, controldata 115 may be 8 KiloBytes in size. Although only one device driver 114is shown in FIG. 1, storage medium 110 typically stores multiple devicedrivers. In addition, storage medium 110 also may store other programsand data. Device driver 114 and device driver control data updateinstructions 117 may or may not be part of the operating system 112.

[0012]FIG. 1 shows non-volatile memory 120 containing supplementaldevice driver control data 127. Non-volatile memory 120 may be, forexample, a 256 KiloBytes or 1 MegaByte flash memory. In the alterative,non-volatile memory 120 may be on the processor chip or may be a seconddisk storage device. A person of skill in the art will appreciate thatnon-volatile memory 120 may be any non-volatile memory device.

[0013] In one embodiment, supplemental device driver control data 127 isused by device driver 114 in addition to, or instead of, some or all ofcontrol data 115. Supplemental device driver control data 127 may beorganized as a data structure, as discussed below with reference to FIG.4. Supplemental device driver control data 127 may be stored onnon-volatile memory 120 as part of a firmware hub. In a furtherembodiment, supplemental device driver control data 127 may be stored onnon-volatile memory 120 as part of Basic Input Output System (BIOS)supplemental data.

[0014] Driver control data update instructions 117 are executed byprocessor 101 to modify or add to the control data used by one or moredevice drivers. For example, control data update instructions 117 may beperformed to update the driver control data used by device driver 114through a modification of supplemental device driver control data 127.The driver control data update instructions 117 may be implemented, forexample, in a high level procedural or object-oriented compiled orinterpreted language programming language. However, the programs can beimplemented in assembly or machine language.

[0015]FIG. 2 shows a flow chart of a method of updating device drivercontrol data according to one embodiment of the present invention. Arequest to update device driver control data is received (201), and newdevice driver control data is received (202). The new device drivercontrol data may be received, for example, through modem 108 over anetwork such as the Internet. In another embodiment, new device drivercontrol data may be received over a local area network from a server. Aperson of ordinary skill in the art would appreciate that the new devicedriver control data may be provided by any other known means. In oneembodiment, the device driver control data update instructions 117compares the new device driver control data with the supplemental devicedriver data 127 stored on non-volatile memory 120 to determine if thesupplemental device driver data 127 already contains the updated data(203). If the nonvolatile memory 120 already contains the supplementaldata, then it does not need to be updated and the process terminates. Ifthe non-volatile memory 120 does not contain the supplemental data orcontains different supplemental data, then the new device driver controldata is written (204) to non-volatile memory 120.

[0016] One method by which the device driver obtains supplemental devicedriver control data is shown in FIG. 3. According to one embodiment, thedevice driver may need to update its control data whenever the devicedriver is initiated (301). Device driver control data 115 is then read(302) from the non-volatile memory 120 into the system memory 103. Thedevice driver may determine if the non-volatile memory 120 containssupplemental device driver control data (303). If the non-volatilememory does not contain supplemental device driver control data, thenthe control data 115 may be used, and the device driver proceeds tonormal operation without updating the driver control data. If thenon-volatile memory does contain supplemental device driver control data127, then the supplemental device driver control data 127 is read intosystem memory (304) and the device driver control data 115 that had beenread into system memory is replaced or added to with the supplementaldevice driver control data (305). According to one embodiment, thesupplemental control data is read by reading the size of the datastructure and caching the entire data structure into system memory as ablock. In a further embodiment, prior to using the supplemental controldata, a checksum for the data structure is verified and a data structureversion is read to determine the version of the data structure beingused. In another embodiment, the device driver 114 accesses thesupplemental device driver control data 127 indirectly though drivercontrol data update instructions 117.

[0017] An embodiment of a device driver supplemental control datastructure is shown in FIG. 4. The supplemental control data structure400 shown in FIG. 4 contains a header 410 and three tables 420, 430, and440. The header may contain a signature field 411, a size field 412, achecksum field 413, a version field 414, and three table offset fields415, 416, and 417. The signature field 411 may be, for example, a stringof 8 characters and may be used to identify the supplemental controldata table 400 in non-volatile memory device 120. The size field 412 maycontain the size of structure 200 (for example, 8 KiloBytes) and may beused by the device driver 114 when reading the device driversupplemental data. The checksum 413 may be used to verify the validityof the table 200, and the version 414 may be used to determine whichversion of the supplemental driver control data structure is being used.Each table offset field contains the offset to the address of one of thetables. For example, table offset 415 may be the offset to table 420,table offset 416 may be the offset to table 430, and table offset 417may be the offset to table 440.

[0018] Each table may contain: a field for the number of entries; anentry size field; and one or more table entries. For example, table 420may contain a number of entries field 421 that specifies the number n ofentries in table 420, and an entry size field 422 that specifies thesize of each entry in table 420. Each table may contain a different typeof driver control data. Tables 420, 430, and 440 may be, for example, adot clock data table, a control register data table, and a watermarkdata table. In this example, the number of entries in the dot clock datatable typically maybe 50, and the size of each entry typically may be 25bytes.

[0019] The driver control data update instructions 117 may add a newtable to structure 400 by appending a new table offset to the end ofheader 410 and by appending the new table itself after the end of thelast table. If the structure were as shown in FIG. 4, for example, a newfourth table may be added by appending a table-four offset after the endof header 410, and by appending the forth table to the end of the thirdtable 440. Similarly, new entries may be added to any of the tables byincreasing the number of entries field and by appending the new entriesto the end of the table. In this way, the content of the device driversupplemental data may be easily modified in the future. Althoughstructure 400 is described herein, supplemental device driver data 127may be stored using other data structures.

[0020] In one embodiment, the device driver 114 determines whether anitem of supplemental driver control data 127 corresponds to an item ofdevice driver control data 115 that has been read into system memory103. If the item of supplemental data corresponds to an item of drivercontrol data in system memory, the device driver replaces the item ofdriver control data in system memory with the corresponding supplementaldriver control data. If the item of supplemental data does notcorrespond to any item of driver control data is system memory, thedevice driver adds the item of supplemental driver control data to thedriver control data stored in system memory.

[0021] If, as in the example above, structure 400 contains supplementalcontrol data for a video driver, then the nth entry in each table, takenas a set of parameters, may specify a single video driver “mode.” Anexample of a video driver mode might be one that supports 1024 bit×768bit×16 bit resolution. A video driver mode may be specified, forexample, by the 3^(rd) entry in dot clock data table 420, the 3^(rd)entry in control register data table 430, and the 3^(rd) entry inwatermark data table 440. A new video driver mode may be added in thisexample by adding a new entry to the dot clock data table 420, thecontrol register data table 430, and watermark data table 440. Inaddition, a new mode may be disabled by clearing the entry for that modein each table.

[0022] Embodiments of the present invention provide device drivers withforward compatibility, and allow for driver control data updates,without modifying the contents of the storage medium that stores thedevice driver. Although several embodiments of the present invention arespecifically illustrated and/or described herein, it will be appreciatedthat modifications and variations of the present invention are coveredby the above teachings and within the purview of the appended claimswithout departing from the spirit and intended scope of the invention.The driver control data update instructions may be stored on a differentstorage medium that the device driver. As a further example, the stepsshown in FIGS. 2 and 3 can be re-ordered where appropriate and one ormore of those steps may be executed concurrently or omitted. Anotherexample of a modification covered by the above teachings and within thepurview of the appended claims is an implementation on computer hardwareother than that shown in FIG. 1. In addition, a data structure otherthan that shown in FIG. 4 may be used in the invention.

What is claimed is:
 1. A method of updating control data for a devicedriver that is stored on a first nonvolatile memory, comprising writingnew driver control data to a second nonvolatile memory.
 2. The method ofclaim 1, wherein the device driver is a video driver and the controldata is video driver mode data.
 3. The method of claim 2, wherein thedriver control data is stored on the second non-volatile memory in astructure that comprises one or more tables, wherein the tables have nentries, and wherein a video driver mode is specified by a set ofparameters comprising of the nth entry in each of the tables.
 4. Themethod of claim 3, wherein a new type of video driver control data maybe provided by adding a new table to the structure, and wherein a newvideo driver mode may be added by adding a new entry to each of thetables.
 5. A method of updating device driver control data for acomputer system having a non-volatile disk storage device and a secondnon-volatile memory, comprising: storing new device driver control datain the second non-volatile memory without modifying data stored in thenon-volatile disk storage device.
 6. The method of claim 5, wherein anew device driver mode may be provided by storing a set of modeparameters in the second non-volatile memory.
 7. An apparatus forupdating the driver control data for a device driver that is stored in afirst non-volatile memory, the apparatus comprising: a firstnon-volatile memory to store a device driver; a processor which executesinstructions to perform storing new driver control data on a secondnon-volatile memory.
 8. The apparatus of claim 7, wherein the devicedriver is a video driver and the control data is video driver mode data.9. The apparatus of claim 7, wherein the second non-volatile memory is aflash memory.
 10. A method of obtaining supplemental device drivercontrol data for a device driver stored in a first non-volatile memory,comprising: reading a set of driver control data from the firstnon-volatile memory into a system memory; reading supplemental drivercontrol data from a second non-volatile memory; and updating the set ofdriver control data in the system memory based on the supplementaldriver control data.
 11. The method of claim 10, wherein the devicedriver is a video device driver.
 12. The method of claim 11, wherein thedriver control data comprises at least one of dot clock, controlregister, and watermark data.
 13. The method of claim 10, wherein thefirst non-volatile memory is a disk memory and the second non-volatilememory is a flash memory.
 14. The method of claim 10, wherein updatingthe set of driver control data in system memory comprises: determiningwhether an item of supplemental driver control data corresponds to anitem of driver control data in system memory; if the item ofsupplemental data corresponds to an item of driver control data insystem memory, replacing the item of driver control data in systemmemory with the corresponding supplemental driver control data; and ifthe item of supplemental data does not correspond to any item of drivercontrol data in system memory, adding the item of supplemental drivercontrol data to the set of driver control data in system memory.
 15. Themethod of claim 10, wherein the method of obtaining device driversupplemental control data is performed each time that the device driveris initiated.
 16. The method of claim 10, further comprising:determining if the second non-volatile memory contains supplementaldriver control data; and using the set of driver control data read fromthe first non-volatile memory as the driver control data if the secondnon-volatile memory does not contain supplemental driver control data.17. The method of claim 10, wherein the supplemental driver control datais stored on the second non-volatile memory in a structure comprisingone or more tables, wherein the tables have n entries, and wherein amode is specified by a set parameters comprising the nth entry in eachof the tables.
 18. A computer system, comprising: a central processingunit; a system memory; a first non-volatile memory which stores a devicedriver; and a second non-volatile memory which stores device drivercontrol data.
 19. The computer system of claim 18, wherein the computersystem further comprises a display device, and wherein the device driveris a video driver.
 20. The computer system of claim 19, wherein thefirst non-volatile memory is a disk memory and the second non-volatilememory is a flash memory.
 21. A computer-readable medium having storedthereon a device driver and instructions adapted to be executed by aprocessor, the instructions which, when executed, cause the processor toupdate the control data for the device driver by: reading a set ofdriver control data from a first non-volatile memory into a systemmemory; reading supplemental driver control data from a secondnon-volatile memory; and updating the set of driver control data in thesystem memory based on the supplemental driver control data.
 22. Thecomputer-readable medium of claim 21, wherein the device driver is avideo device driver.
 23. The computer-readable medium of claim 21,wherein the driver control data comprises at least one of dot clock,control register, and watermark data.
 24. The computer-readable mediumof claim 21, wherein the first non-volatile memory is a disk memory andthe second non-volatile memory is a flash memory.
 25. Thecomputer-readable medium of claim 21, wherein updating the drivercontrol data in system memory comprises: determining whether an item ofsupplemental driver control data corresponds to an item of drivercontrol data in system memory; if the item of supplemental datacorresponds to an item of driver control data in system memory,replacing the item of driver control data in system memory with thecorresponding supplemental driver control data; and if the item ofsupplemental data does not correspond to any item of driver control datais system memory, adding the item of supplemental driver control data tothe set of driver control data in system memory.
 26. The computerreadable medium of claim 21, wherein the updating the control data isperformed each time that the device driver is initiated.
 27. Thecomputer readable medium of claim 21, wherein the instructions furthercause the processor further to update the control data for the devicedriver by: determining if the second non-volatile memory containssupplemental driver control data; and using the set of driver controldata from the first non-volatile memory as the driver control data ifthe second non-volatile memory does not contain supplemental drivercontrol data.
 28. The computer readable medium of claim 21, wherein thesupplemental driver control data is stored on the second non-volatilememory in a structure comprising tables, wherein the tables have nentries, and wherein a mode is specified by a set of parameterscomprising the nth entry in each of the tables.